package com.study.algorithm.datastruct.graph.model;

public class Edge {
    private Vertex startVetex;
    private Vertex endVetex;
    private Integer distance;

    public Edge(Vertex startVetex, Vertex endVetex) {
        if (startVetex == null || endVetex == null) {
            throw new IllegalArgumentException("构建边顶点参数不能为空");
        }
        this.startVetex = startVetex;
        this.endVetex = endVetex;
    }

    public Vertex getStartVetex() {
        return startVetex;
    }

    public void setStartVetex(Vertex startVetex) {
        this.startVetex = startVetex;
    }

    public Vertex getEndVetex() {
        return endVetex;
    }

    public void setEndVetex(Vertex endVetex) {
        this.endVetex = endVetex;
    }

    public Integer getDistance() {
        return distance;
    }

    public void setDistance(Integer distance) {
        this.distance = distance;
    }
}
